package icu.decade.store.controller;

import icu.decade.store.result.ResponseResult;
import icu.decade.store.entity.SysUser;
import icu.decade.store.security.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private LoginService loginServcie;

    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody SysUser user){
        return loginServcie.login(user);
    }
    @PostMapping("/user/logout")
    public ResponseResult logout(@RequestBody SysUser user){
        return loginServcie.logout(user);
    }

}
